package collection;

import java.util.Collection;
import java.util.ArrayList;

public class CollectionDemo4 {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        c.add("java");
        c.add("php");
        c.add("c++");
        System.out.println(c);

        Collection c1 = new ArrayList();
        c1.add("android");
        c1.add("ios");
        c1.add("c#");
        System.out.println(c1);

        Collection c2 = new ArrayList();
        c2.add("c++");
        c2.add("HI");
        c2.add("c#");

        c.addAll(c1);
        System.out.println(c);
        System.out.println(c1);

        boolean b = c.containsAll(c2);
        System.out.println(b);

        c.retainAll(c2);
        System.out.println(c);

        c.removeAll(c1);
        System.out.println(c);


    }
}